package com.ess.web.controller.sys;


import com.blgroup.b2b.common.constant.SysMessage;
import com.blgroup.b2b.common.entity.PingInfo;
import com.blgroup.b2b.web.service.sys.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * 
 * 系统功能维护
 * 
 * @ClassName: SysController 
 * @author tylong
 * @date 2016年12月5日 下午6:11:26
 * @version v3.0 
 *
 */
@Controller
@RequestMapping(value = "/sys")
public class SysController {
	
	@Autowired
	UserService userService;
	
	private static final Logger logger = LoggerFactory.getLogger(SysController.class);
	

	/**
	 * 
	 * 方法描述：   主页面
	 * 业务逻辑说明  ：主页面 
	 * @Title: index 
	 * @date 2016年12月2日 上午10:18:06
	 * @author tylong
	 * @modifier 
	 * @modifydate 
	 * @param model
	 * @param request
	 * @return
	 */
	@RequestMapping("/test")
	public ModelAndView index(Model model, HttpServletRequest request) {
		ModelAndView mv=new ModelAndView("sys/test");
		return mv;
	}
	/**
	 * 心跳测试
	 * @param request
	 * @param response
	 * @param dto
	 * @return
	 */
	@RequestMapping("/ping")
	@ResponseBody
	public Object ping(HttpServletRequest request, HttpServletResponse response) {
		PingInfo result=new PingInfo();
		result.setResCode(SysMessage.SYSTEM_SUCCESS_CODE);
		result.setMsg("I am working!");
		return result;
	}
}
